﻿using System;
using Shell.Build;

namespace Shell
{
    internal class DefaultShellExtensionContext : ShellExtensionContext
    {
        private readonly DefaultShell shell;

        public DefaultShellExtensionContext(DefaultShell shell)
        {
            this.shell = shell;
        }

        public override IBuildChainMaker<BuildStage> BuildChainMaker
        {
            get { return this.shell.BuildChainMaker; }
        }

        public override IBuildPolicyCollection BuildPolicies
        {
            get { return this.shell.BuildPolicyCollection; }
        }

        public override ILifetimeContainer LifetimeContainer
        {
            get { return this.shell.LifetimeContainer; }
        }

        public override IShell Shell
        {
            get { return this.shell; }
        }

        public override event EventHandler<InstanceRegisterEventArgs> InstanseRegistered
        {
            add { this.shell.InstanseRegistered += value; }
            remove { this.shell.InstanseRegistered -= value; }
        }

        public override event EventHandler<TypeRegisterEventArgs> TypeRegistered
        {
            add { this.shell.TypeRegistered += value; }
            remove { this.shell.TypeRegistered -= value; }
        }
    }
}
